var register={
    URL:{
        register:function (userName,password,userPhone) {
            return '/user/'+userName+'/'+password+'/'+userPhone+'/register';
        },
        login:function () {
            return '/user/login';
        }
    },
    register:{
        init:function () {
            $('#registerBtn').one('click',function () {
                var userName=$('#inputusername3').val();
                var password=$('#inputPassword3').val();
                var userPhone=$('#inputPhone3').val();
                if(userName===""||password===""||userPhone===""){
                    alert("所有信息必须填写！");
                    return;
                }
                var passwordMd5 = $.md5(password+"162846^*^(^hdukw");
                $.post(register.URL.register(userName,passwordMd5,userPhone),{},function (result) {
                    if(result){
                        if(result['register']){
                            alert(result['info']);
                            $(window).attr('location',register.URL.login());
                        }else{
                            alert(result['info']);
                        }

                    }else {
                        alert('系统异常！');
                    }
                });
            })
        }
    }
}